package cl.rizepe.playntest.core.views;

import pythagoras.f.Point;

public class LayerProperties {
	float alpha;
//	int backgroundColor;
//	int pivotX,pivotY;
	float rotation;
	float scale, scaleX, scaleY;
	Point origin;
	Point translate;
	Point size;
	
	public LayerProperties (EffectedLayer layerState){
		alpha=layerState.alpha();
	//	backgroundColor=layerState.getImageLayer().;
		
		rotation=layerState.getRotation();
		scaleX=layerState.transform().scaleX();
		scaleY=layerState.transform().scaleY();
		origin=layerState.getOrigin();
		translate=layerState.getTranslate();
		size=layerState.getSize();
	}
	
	public void applyTo(EffectedLayer layerState){
		layerState.setRotation(rotation);
		layerState.setAlpha(alpha);
		layerState.setOrigin(origin.x(), origin.y());
		layerState.setTranslation(translate.x(), translate.y());
		layerState.setScale(scale);
		layerState.transform().setScaleX(scaleX);
		layerState.transform().setScaleY(scaleY);
	}
	
	public double getAlpha() {
		return alpha;
	}
	public void setAlpha(float alpha) {
		this.alpha = alpha;
	}/*
	public int getBackgroundColor() {
		return backgroundColor;
	}
	public void setBackgroundColor(int backgroundColor) {
		this.backgroundColor = backgroundColor;
	}/*
	public int getPivotX() {
		return pivotX;
	}
	public void setPivotX(int pivotX) {
		this.pivotX = pivotX;
	}
	public int getPivotY() {
		return pivotY;
	}
	public void setPivotY(int pivotY) {
		this.pivotY = pivotY;
	}*/
	public double getRotation() {
		return rotation;
	}
	public void setRotation(float rotation) {
		this.rotation = rotation;
	}
	public double getScale() {
		return scale;
	}
	public void setScale(float scale) {
		this.scale = scale;
	}
	public double getScaleX() {
		return scaleX;
	}
	public void setScaleX(float scaleX) {
		this.scaleX = scaleX;
	}
	public double getScaleY() {
		return scaleY;
	}
	public void setScaleY(float scaleY) {
		this.scaleY = scaleY;
	}
	public Point getOrigin() {
		return origin;
	}
	public void setOrigin(Point origin) {
		this.origin = origin;
	}
	public Point getTranslate() {
		return translate;
	}
	public void setTranslate(Point translate) {
		this.translate = translate;
	}
	public Point getSize() {
		return size;
	}
	public void setSize(Point size) {
		this.size = size;
	}
}
